-- EX01_SungJukVO 
--  sjno, name, kor, eng, mat, tot, avg, grd
-- EX01_ISungJukService
--	createSungJuk();
-- EX01_SungJukService
-- 	createSungJuk( ){ }
-- EX01_ISungJukDAO
-- insertSungJuk();
-- EX01_SungJukDAO
-- insertSungJuk( ){ }
-- EX01_SungJukMain

-- 여행 테이블 생성

create table Accommodation(
 Accommodation_No varchar2(100),
 Accommodation_Types varchar2(100),
 Accommodation_Informations varchar2(100),
 Accommodation_Locations varchar2(100),
 Accommodation_Votes varchar2(100),
 Travel_No varchar2(100),
 
 constraint Accommodation_pk primary key(Accommodation_No)
 );

create table region(
region_code varchar2(100),
region_name varchar2(100)constraint rn_nn not null,
constraint rc_pk primary key (region_code)
);
 
insert into region
	values('rg - ' || to_char(regions.nextval), '하와이');





create table Travel_Informetion(
travel_code varchar2(100),
travel_Place varchar2(100) constraint tp_nn not null, --nn 여행지 이름
region_code varchar2(100), --fk 지역코드
travel_duration varchar2(100), --여행기간
accommodation_code varchar2(100), --fk 숙박지코드
travel_price number(10), --대략 가격
travel_introduction varchar2(100),
travel_notice varchar2(100),	--특이사항
travel_votes number(10),	--추천수
travel_level varchar2(100),--uk 여행지레벨
travel_image varchar2(100), --uk
constraint tc_pk primary key (travel_code),
constraint rc_fk foreign key (region_code) references region (region_code),
constraint ac_fk unique (accommodation_code),
constraint tl_uk unique (travel_level),
constraint ti_uk unique (travel_image)
);

insert into travel_Informetion
values('tc - ' || to_char(travel_nextval), '오아후', 'rg - 10', '1주일', '20' ,'1000' ,'주의합시다' ,'좋다~' , '0' ,'하이','하와이' );







drop table Travel_Informetion;

-- 시퀀스 생성
create sequence travel
	start with 1
	increment by 1
	nocache;
create sequence regions
	start with 1
	increment by 1
	nocache;
	
create sequence accommodations
start with 1
increment by 1
nocache;
